﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="TagFlo.TagDialog"
    Title="TagFlo" Height="400" Width="400"
	Closing="OnClose"
	ResizeMode="NoResize"
     Foreground="{DynamicResource ForegroundBrush}"
    BorderBrush="{DynamicResource BorderBrush}"
    Background="{DynamicResource BackgroundBrush}" 
   
    >
	
	<Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="..\Resources\ResourceDictionary.xaml"/>
                <ResourceDictionary Source="..\Resources\ControlStyle.xaml"/>
                <ResourceDictionary Source="..\Themes\current.theme.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <DataTemplate x:Key="TagButtonTemplate">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Path=TagName}" Width="120"/>
                    <Button x:Name="RemoveTagButton" Width="20" Click="RemoveTagButton_Click" >-</Button>
                </StackPanel>
            </DataTemplate>
        </ResourceDictionary>
    </Window.Resources>
	
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.5*"/>
			<ColumnDefinition Width="0.5*"/>
		</Grid.ColumnDefinitions>

        <ListBox Margin="8,37.96,8,66" x:Name="TagSetListBox" SelectionChanged="TagSetListBox_SelectionChanged"  ItemsSource="{Binding}" DisplayMemberPath="TagSetName"/>
        <TextBox Margin="8,0,60.623,33.96" VerticalAlignment="Bottom" Text="" x:Name="TagSetTextBox" TextWrapping="Wrap" />
        <Button Content="Add..." HorizontalAlignment="Right" Margin="0,0,8,33.96" x:Name="AddButton" VerticalAlignment="Bottom" Width="48.623" Click="AddButton_Click" />
        <Button Content="Remove" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="48.623" Margin="0,0,8,8" x:Name="RemoveButton" Click="RemoveButton_Click"/>

        <StackPanel Grid.Column="1">
        <ComboBox   x:Name="TagButtonComboBox" IsEditable="True" Text="{Binding Path=TagText, Mode=TwoWay}" Width="150"  PreviewKeyDown="TagButton_PreviewKeyDown"/>
       
        <ListBox    Margin="8,8,8,8" x:Name="TagButtonListBox" ItemsSource="{Binding }" ItemTemplate="{StaticResource TagButtonTemplate}" 	/>
	</StackPanel>
	</Grid>
</Window>
